<%@page import="cn.com.codingce.student.entity.Login" %>
<%@page import="cn.com.codingce.student.entity.Page" %>
<%@page import="cn.com.codingce.student.entity.Student" %>
<%@page import="java.util.List" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>学生管理系统</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="robots" content="all,follow">
    <!-- Bootstrap CSS-->
    <link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome CSS-->
    <link rel="stylesheet" href="vendor/font-awesome/css/font-awesome.min.css">
    <!-- Fontastic Custom icon font-->
    <link rel="stylesheet" href="css/fontastic.css">
    <!-- Google fonts - Poppins -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:300,400,700">
    <!-- theme stylesheet-->
    <link rel="stylesheet" href="css/style.default.css" id="theme-stylesheet">
    <!-- Custom stylesheet - for your changes-->
    <link rel="stylesheet" href="css/custom.css">
    <!-- Favicon-->
    <link rel="shortcut icon" href="img/favicon.ico">
    <!-- Tweaks for older IEs--><!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script><![endif]-->
</head>
<body>
<div class="page">
    <!-- Main Navbar-->
    <header class="header">
        <nav class="navbar">
            <!-- Search Box-->
            <div class="search-box">
                <button class="dismiss"><i class="icon-close"></i></button>
                <form id="searchForm" action="#" role="search">
                    <input type="search" placeholder="搜索" class="form-control">
                </form>
            </div>
            <div class="container-fluid">
                <div class="navbar-holder d-flex align-items-center justify-content-between">
                    <!-- Navbar Header-->
                    <div class="navbar-header">
                        <!-- Navbar Brand --><a href="querybypage" class="navbar-brand d-none d-sm-inline-block">
                        <div class="brand-text d-none d-lg-inline-block"><span>学生管理系统 </span><strong></strong></div>
                        <div class="brand-text d-none d-sm-inline-block d-lg-none"><strong>津泽</strong></div>
                    </a>
                        <!-- Toggle Button--><a id="toggle-btn" href="#"
                                                class="menu-btn active"><span></span><span></span><span></span></a>
                    </div>
                    <!-- Navbar Menu -->
                    <ul class="nav-menu list-unstyled d-flex flex-md-row align-items-md-center">
                        <!-- Search-->
                        <li class="nav-item d-flex align-items-center"><a id="search" href="#"><i
                                class="icon-search"></i></a></li>
                        <!-- Notifications-->
                        <li class="nav-item dropdown"><a id="notifications" rel="nofollow" data-target="#" href="#"
                                                         data-toggle="dropdown" aria-haspopup="true"
                                                         aria-expanded="false" class="nav-link"><i
                                class="fa fa-bell-o"></i><span class="badge bg-red badge-corner">1</span></a>
                            <ul aria-labelledby="notifications" class="dropdown-menu">
                                <li><a rel="nofollow" href="#" class="dropdown-item">
                                    <div class="notification">
                                        <div class="notification-content"><i class="fa fa-envelope bg-green"></i>厚德載物
                                        </div>
                                        <div class="notification-time"><small>4 分钟前</small></div>
                                    </div>
                                </a></li>


                                <li><a rel="nofollow" href="#" class="dropdown-item all-notifications text-center">
                                    <strong>查看所有消息 </strong></a></li>
                            </ul>
                        </li>


                        <!-- Messages                        -->
                        <li class="nav-item dropdown"><a id="messages" rel="nofollow" data-target="#" href="#"
                                                         data-toggle="dropdown" aria-haspopup="true"
                                                         aria-expanded="false" class="nav-link"><i
                                class="fa fa-envelope-o"></i><span class="badge bg-orange badge-corner">1</span></a>
                            <ul aria-labelledby="notifications" class="dropdown-menu">
                                <li><a rel="nofollow" href="#" class="dropdown-item d-flex">
                                    <div class="msg-profile"><i class="fa fa-envelope bg-green"></i></div>
                                    <div class="msg-body">
                                        <h3 class="h5">马鑫泽</h3><span>会话中</span>
                                    </div>
                                </a></li>

                                <li><a rel="nofollow" href="#" class="dropdown-item all-notifications text-center">
                                    <strong>读取全部内容 </strong></a></li>
                            </ul>
                        </li>

                        <!-- Logout    -->
                        <li class="nav-item"><a href="login.jsp" class="nav-link logout"> <span
                                class="d-none d-sm-inline">退出登录</span><i class="fa fa-sign-out"></i></a></li>
                    </ul>
                </div>
            </div>
        </nav>
    </header>
    <div class="page-content d-flex align-items-stretch">
        <!-- Side Navbar -->
        <nav class="side-navbar">
            <!-- Sidebar Header-->
            <div class="sidebar-header d-flex align-items-center">
                <div class="avatar"><img src="" alt="" class="img-fluid rounded-circle"></div>
                <div class="title">
                    <h1 class="h4">${teaname}</h1>
                    <p>管理员</p>
                </div>
            </div>
            <!-- Sidebar Navidation Menus--><span class="heading">功能区</span>
            <ul class="list-unstyled">
                <li class="active"><a href="querybypage"> <i class="icon-home"></i>主页 </a></li>
                <li><a href="#exampledropdownDropdown" aria-expanded="false" data-toggle="collapse"> <i
                        class="icon-interface-windows"></i>添加</a>
                    <ul id="exampledropdownDropdown" class="collapse list-unstyled ">
                        <li><a href="add.jsp">学生</a></li>
                        <li><a href="addTea.jsp">教师</a></li>
                        <li><a href="#">暂未开放</a></li>
                    </ul>
                </li>
                <li><a href="login.jsp"> <i class="icon-interface-windows"></i>重新登录</a></li>
            </ul>
            <span class="heading">开发区(正在进行开发)</span>
            <ul class="list-unstyled">
                <li><a href="#"> <i class="icon-flask"></i>实验室 </a></li>
                <li><a href="#"> <i class="icon-screen"></i>显示 </a></li>
                <li><a href="#"> <i class="icon-mail"></i>信息 </a></li>
                <li><a href="#"> <i class="icon-picture"></i>学生照片 </a></li>
            </ul>
        </nav>
        <div class="content-inner">
            <!-- Page Header-->
            <header class="page-header">
                <div class="container-fluid">
                    <h2 class="no-margin-bottom">主页</h2>
                </div>
            </header>
            <!-- Dashboard Counts Section-->
            <section class="dashboard-counts no-padding-bottom">
                <div class="container-fluid">
                    <div class="row bg-white has-shadow">
                        <!-- Item -->
                        <div class="col-xl-3 col-sm-6">
                            <div class="item d-flex align-items-center">
                                <div class="icon bg-violet"><i class="icon-user"></i></div>
                                <div class="title"><span>学生人数<br></span>
                                    <div class="progress">
                                        <div role="progressbar" style="width: 25%; height: 4px;" aria-valuenow="25"
                                             aria-valuemin="0" aria-valuemax="100" class="progress-bar bg-violet"></div>
                                    </div>
                                </div>
                                <div class="number"><strong>${stuCount}</strong></div>
                            </div>
                        </div>
                        <!-- Item -->
                        <div class="col-xl-3 col-sm-6">
                            <div class="item d-flex align-items-center">
                                <div class="icon bg-red"><i class="icon-padnote"></i></div>
                                <div class="title"><span>教师数量<br></span>
                                    <div class="progress">
                                        <div role="progressbar" style="width: 70%; height: 4px;" aria-valuenow="70"
                                             aria-valuemin="0" aria-valuemax="100" class="progress-bar bg-red"></div>
                                    </div>
                                </div>
                                <div class="number"><strong>${teaCount}</strong></div>
                            </div>
                        </div>
                        <!-- Item -->
                        <div class="col-xl-3 col-sm-6">
                            <div class="item d-flex align-items-center">
                                <div class="icon bg-green"><i class="icon-bill"></i></div>
                                <div class="title"><span>开发中<br></span>
                                    <div class="progress">
                                        <div role="progressbar" style="width: 60%; height: 4px;" aria-valuenow="40"
                                             aria-valuemin="0" aria-valuemax="100" class="progress-bar bg-green"></div>
                                    </div>
                                </div>
                                <div class="number"><strong></strong></div>
                            </div>
                        </div>
                        <!-- Item -->
                        <div class="col-xl-3 col-sm-6">
                            <div class="item d-flex align-items-center">
                                <div class="icon bg-orange"><i class="icon-check"></i></div>
                                <div class="title"><span>开发中<br></span>
                                    <div class="progress">
                                        <div role="progressbar" style="width: 50%; height: 4px;" aria-valuenow="50"
                                             aria-valuemin="0" aria-valuemax="100" class="progress-bar bg-orange"></div>
                                    </div>
                                </div>
                                <div class="number"><strong></strong></div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
            <!-- Dashboard Header Section    -->
            <section class="dashboard-header">
                <div class="container-fluid">

                </div>
            </section>

            <!-- Feeds Section-->
            <section class="feeds no-padding-top">
                <div class="container-fluid">
                    <div class="row">
                        <!-- Trending Articles-->
                        <div class="col-lg-6">
                            <div class="articles card">
                                <div class="card-close">
                                    <div class="dropdown">
                                        <button type="button" id="closeCard4" data-toggle="dropdown"
                                                aria-haspopup="true" aria-expanded="false" class="dropdown-toggle"><i
                                                class="fa fa-ellipsis-v"></i></button>
                                        <div aria-labelledby="closeCard4"
                                             class="dropdown-menu dropdown-menu-right has-shadow"><a href="#"
                                                                                                     class="dropdown-item remove">
                                            <i class="fa fa-times"></i>关闭</a><a href="#" class="dropdown-item edit"> <i
                                                class="fa fa-gear"></i>编辑</a></div>
                                    </div>
                                </div>
                                <div class="card-header d-flex align-items-center">
                                    <h2 class="h3">学生表 </h2>
                                    <div class="badge badge-rounded bg-green">学生</div>
                                </div>
                                <div class="card-body no-padding">
                                    <table class="table">
                                        <tr>
                                            <th>学号</th>
                                            <th>姓名</th>
                                            <th>年龄</th>
                                            <th>地址</th>
                                            <th>操作</th>
                                        </tr>
                                        <%
                                            /*
                                            获取request域中的数据
                                            */
                                            Page p = (Page) request.getAttribute("p");


                                            for (Student student : p.getStudents()) {

                                        %>
                                        <tr>
                                            <td>
                                                <a href="QueryStudentServlet?sno=<%= student.getSno() %>"><%=student.getSno() %>
                                                </a></td>
                                            <td><%=student.getSname() %>
                                            </td>
                                            <td><%=student.getSage() %>
                                            </td>
                                            <td><%=student.getSaddress() %>
                                            </td>
                                            <td><a href="DeleteStudentSelvlet?sno=<%= student.getSno() %>">删除</a></td>
                                        </tr>
                                        <%
                                            }
                                        %>
                                        <tr>
                                            <th><a href="add.jsp">新增</a></th>
                                            <%
                                                if (p.getCurrentPage() == p.getTotalCount()) {
                                            %>
                                            <th><a style="float:left" href="QueryStudentByPage?currentPage=1">首页</a>
                                            </th>
                                            <th><a style="float:left"
                                                   href="QueryStudentByPage?currentPage=<%=p.getCurrentPage()-1%>"
                                                   class="">上一页</a></th>
                                            <%
                                            } else if (p.getCurrentPage() == 1) {
                                            %>
                                            <th><a style="float:left"
                                                   href="QueryStudentByPage?currentPage=<%=p.getCurrentPage()+1%>"
                                                   class="">下一页</a></th>
                                            <th><a style="float:left"
                                                   href="QueryStudentByPage?currentPage=<%=p.getTotalCount()%>"
                                                   class="">尾页</a></th>
                                            <%
                                            } else {
                                            %>
                                            <th><a style="float:left" href="QueryStudentByPage?currentPage=1">首页</a>
                                            </th>
                                            <th><a style="float:left"
                                                   href="QueryStudentByPage?currentPage=<%=p.getCurrentPage()-1%>"
                                                   class="">上一页</a></th>
                                            <th><a style="float:left"
                                                   href="QueryStudentByPage?currentPage=<%=p.getCurrentPage()+1%>"
                                                   class="">下一页</a></th>
                                            <th><a style="float:left"
                                                   href="QueryStudentByPage?currentPage=<%=p.getTotalCount()%>"
                                                   class="">尾页</a></th>
                                        </tr>
                                        <%} %>

                                    </table>


                                </div>
                            </div>
                        </div>
                        <!-- Check List -->


                    </div>
                </div>
            </section>
            <!-- Updates Section                                                -->
            <section class="updates no-padding-top">
                <div class="container-fluid">
                    <div class="row">
                        <!-- Recent Updates-->

                        <!-- Daily Feeds -->

                        <div class="col-lg-6">
                            <div class="articles card">
                                <div class="card-close">
                                    <div class="dropdown">
                                        <button type="button" id="closeCard4" data-toggle="dropdown"
                                                aria-haspopup="true" aria-expanded="false" class="dropdown-toggle"><i
                                                class="fa fa-ellipsis-v"></i></button>
                                        <div aria-labelledby="closeCard4"
                                             class="dropdown-menu dropdown-menu-right has-shadow"><a href="#"
                                                                                                     class="dropdown-item remove">
                                            <i class="fa fa-times"></i>关闭</a><a href="#" class="dropdown-item edit"> <i
                                                class="fa fa-gear"></i>编辑</a></div>
                                    </div>
                                </div>
                                <div class="card-header d-flex align-items-center">
                                    <h2 class="h3">教师表 </h2>
                                    <div class="badge badge-rounded bg-green">教师</div>
                                </div>
                                <div class="card-body no-padding">

                                    <table class="table">
                                        <tr>
                                            <th>账号</th>
                                            <th>姓名</th>
                                            <th>密码</th>
                                            <th>操作</th>
                                        </tr>
                                        <%
                                            /*
                                            获取request域中的数据
                                            */

                                            List<Login> teachers = (List<Login>) request.getAttribute("teachers");


                                            for (Login tea : teachers) {

                                        %>
                                        <tr>
                                            <td><a href="QueryTeacherServlet?id=<%=tea.getId()%>"><%=tea.getId()%>
                                            </a></td>
                                            <td><%=tea.getUname() %>
                                            </td>
                                            <td><%=tea.getUpwd()%>
                                            </td>
                                            <td><a href="DeleteTeacherServlet?id=<%= tea.getId() %>">删除</a></td>
                                        </tr>
                                        <%
                                            }
                                        %>
                                        <tr>
                                            <th><a href="addTea.jsp">新增</a></th>
                                        </tr>
                                    </table>

                                </div>
                            </div>
                        </div>


                        <!-- Recent Activities -->
                        <div class="col-lg-4">
                            <div class="recent-activities card">
                                <div class="card-close">
                                    <div class="dropdown">
                                        <button type="button" id="closeCard8" data-toggle="dropdown"
                                                aria-haspopup="true" aria-expanded="false" class="dropdown-toggle"><i
                                                class="fa fa-ellipsis-v"></i></button>
                                        <div aria-labelledby="closeCard8"
                                             class="dropdown-menu dropdown-menu-right has-shadow"><a href="#"
                                                                                                     class="dropdown-item remove">
                                            <i class="fa fa-times"></i>关闭</a><a href="#" class="dropdown-item edit"> <i
                                                class="fa fa-gear"></i>编辑</a></div>
                                    </div>
                                </div>
                                <div class="card-header">
                                    <h3 class="h4">提示</h3>
                                </div>
                                <div class="card-body no-padding">
                                    <div class="item">
                                        <div class="row">
                                            <div class="col-4 date-holder text-right">
                                                <div class="icon"><i class="icon-clock"></i></div>
                                                <div class="date"><span>8:00 am</span><br><span
                                                        class="text-info">天行健</span></div>
                                            </div>
                                            <div class="col-8 content">
                                                <h5>打卡</h5>
                                                <p>早上打卡</p>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="item">
                                        <div class="row">
                                            <div class="col-4 date-holder text-right">
                                                <div class="icon"><i class="icon-clock"></i></div>
                                                <div class="date"><span>11:00 am</span><br><span
                                                        class="text-info"></span></div>
                                            </div>
                                            <div class="col-8 content">
                                                <h5>午饭</h5>
                                                <p>不要忘了午餐</p>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="item">
                                        <div class="row">
                                            <div class="col-4 date-holder text-right">
                                                <div class="icon"><i class="icon-clock"></i></div>
                                                <div class="date"><span>18:00 pm</span><br><span
                                                        class="text-info"></span></div>
                                            </div>
                                            <div class="col-8 content">
                                                <h5>下班</h5>
                                                <p>整理学籍</p>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
            <!-- Page Footer-->
            <footer class="main-footer">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-sm-6">
                            <p>津泽科技 &copy; 2017-2019</p>
                        </div>
                        <div class="col-sm-6 text-right">
                            <p>Design by Ma Xinze <a href="#" target="_blank" title="马鑫泽">软件S17-12班</a> - Collect from
                                <a href="#" title="马鑫泽" target="_blank">马鑫泽</a></p>
                            <!-- Please do not remove the backlink to us unless you support further theme's development at https://bootstrapious.com/donate. It is part of the license conditions. Thank you for understanding :)-->
                        </div>
                    </div>
                </div>
            </footer>
        </div>
    </div>
</div>
<!-- JavaScript files-->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/popper.js/umd/popper.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="vendor/jquery.cookie/jquery.cookie.js"></script>
<script src="vendor/chart.js/Chart.min.js"></script>
<script src="vendor/jquery-validation/jquery.validate.min.js"></script>
<script src="js/charts-home.js"></script>
<!-- Main File-->
<script src="js/front.js"></script>

</body>
</html>